package com.weigj.model;

import com.jfinal.plugin.activerecord.Model;

public class Client extends Model<Client> {
	public static final Client dao=new Client();
	
	
	/**
	 * 根据客户的姓名和身份证号查询
	 * @param cilentIdNum 客户身份证号
	 * @param telPhone 手机号
	 * @return
	 */
	public Client queryClientByName(String cilentIdNum,String telPhone){
		String sql="select * from app_newclient n where n.telone=? and n.idnumber=?";
		return dao.findFirst("sql",telPhone,cilentIdNum);
	}
	
	/**
	 * 根据支付宝传过来的客户Id查询系统的客户信息
	 * @param formUserId
	 * @return
	 */
	public Client queryClientByFormUserId(String fromUserId){
		String sql="select * from app_newclient n where n.fromUserId=?";
		return dao.findFirst(sql,fromUserId);
	}
	
}
